package com.lanxin.oa.zc.controller;

import com.lanxin.bean.ZcAssetmoveapply;
import com.lanxin.bean.ZzDepartment;
import com.lanxin.oa.zc.service.ZcYiDongAllService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping("zcydall")
public class ZcYiDongAllController {
    @Autowired
    ZcYiDongAllService ydall;
    @RequestMapping("select")
    public ModelAndView selectzcyd(){
        List<ZzDepartment> list=ydall.selestydall();
        ModelAndView mv=new ModelAndView();
        mv.addObject("list",list);
        mv.setViewName("../view/zc/zcydalllist.jsp");
        return mv;
    }
//
//    @RequestMapping("selectxq1")
//    @ResponseBody
//    public ZcAssetmoveapply selectxq(Integer oid){
//        System.out.println("1111111111111");
//        ZcAssetmoveapply zcydxq=ydall.selectbyid(oid);
//      return zcydxq;
//    }

    @RequestMapping("selectxq")
    public ModelAndView selectydxq(Integer oid){
        System.out.println("1111111111111");
        System.out.println(oid+"22222222222");
        ZcAssetmoveapply zcydxq=ydall.selectbyid(oid);
        System.out.println("list++++"+zcydxq==null);
        ModelAndView mv=new ModelAndView();
        mv.addObject("zcydxq",zcydxq);
        mv.setViewName("../view/zc/ydxq.jsp");
        return mv;
    }

}
